using System;
using Quartz;
using Webshop20.AntiCorruptionLayers.Quartz.Facades.Contracts;
using Webshop20.AntiCorruptionLayers.Quartz.Jobs;

namespace Webshop20.AntiCorruptionLayers.Quartz.Facades.Implementations
{
    public class SchedulerFacade : ISchedulerFacade
    {
        private readonly ISchedulerFactory schedulerFactory;

        public SchedulerFacade(ISchedulerFactory schedulerFactory)
        {
            this.schedulerFactory = schedulerFactory;
        }

        public void ScheduleProcessResurrection(JobDetail jobDetail, Trigger trigger)
        {
            IScheduler scheduler = schedulerFactory.GetScheduler();
            scheduler.Start();
            scheduler.ScheduleJob(jobDetail, trigger); 

        }
    }
}